package com.jiazhong.shixi.caichanguanli.mapper;

import com.jiazhong.shixi.caichanguanli.bean.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UsersMapper {
    @Select("select * from `users` where user_name=#{userName} and `password`=MD5(#{password})")
    Users login(Users user);
    @Insert("insert into `users` values(#{userId},null,#{role},MD5(#{password}),null)")
    int add(Users user);
    @Select("SELECT * FROM users")
    List<Users> selectAll();
}